import {  getList } from '../api'
import actionsType from './actionsType'
const actions = {
  getList() {
    return async dispatch => {
      const resp = await getList()
      dispatch({ type: actionsType.SET_LIST, payload: resp.data.data })
    }
  },
  setCollect(payload) {
    return { type: actionsType.SET_COLLECT, payload }
  },
  addCarList(payload) {
    return { type: actionsType.ADD_CAR_LIST, payload }
  },
  deleteCarList(payload) {
    return { type: actionsType.DELETE_CAR_LIST, payload }
  },
  subCarList(payload) {
    return { type: actionsType.SUB_CAR_LIST, payload }
  },
  switchCarList(payload) {
    return { type: actionsType.SWITCH_CAR_LIST, payload }
  },

  switchCarListAll(payload) {
    return { type: actionsType.SWITCH_CAR_LIST_ALL, payload }
  }
  
}


export default actions